package com.bml.architect.sentinel.controller;

import com.alibaba.csp.sentinel.slots.block.BlockException;

/**
 * @author: baiml
 * @Title: ExceptionUtil
 * @ProjectName: 中台技术平台
 * @Depart 中台研发部
 * @Description:
 * @date: 2021/4/20 11:46
 */
public class ExceptionUtil {
    public static String fallback(Throwable e){
        System.out.println("===被异常降级啦===");
        return "{'errcode:':'-2',msg:'===被异常降级啦==='}";
    }

    public static String handleException( BlockException e){
        System.out.println("===被限流啦===");
        return "{'errcode:':'-2',msg:'===被限流啦==='}";
    }

}
